package com.neulogistics.contrib.warehouse.api.application.command;

import com.blackto.lib.mediat.unicast.IRequest;
import com.neulogistics.contrib.warehouse.api.application.validator.annotation.InList;
import com.neulogistics.contrib.warehouse.api.application.validator.annotation.ValidateAddress;
import com.neulogistics.contrib.warehouse.domain.model.valueobject.Address;
import com.neulogistics.infrastructure.common.serviceresult.BaseResponse;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;

@Data
public class CreateWarehouseCommand implements IRequest<BaseResponse<String>>, Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 库房名
     */
    @NotBlank
    @Size(max = 20, message = "非法的库房名！")
    private String warehouseName;

    /**
     * 库房地址{省，市，区，详细}
     */
    @NotNull
    @ValidateAddress
    private Address warehouseAddress;

    /**
     * 库房等级：0：中心库房；1：分站库房
     */
    @InList(values = {0, 1})
    @NotNull
    private Integer warehouseLevel;
}
